<?php
/**
 * @since 2012.01.23.
 * @author Karasz Tamas
 * @link http://binga.hu/
 * @package Képek megtekintése törlése, felhasználó bannolása stb stb
 * ______ _____ _   _ _____  ___  
 * | ___ \_   _| \ | |  __ \/ _ \ 
 * | |_/ / | | |  \| | |  \/ /_\ \
 * | ___ \ | | | . ` | | __|  _  |
 * | |_/ /_| |_| |\  | |_\ \ | | |
 * \____/ \___/\_| \_/\____|_| |_/
 * 
 */

$albumid = $sql->escape($query_string[2]);
$images = $facebook->brendon_get_gallery_thumbnails($albumid);

foreach ($images as $image){
	$imagesrc[$image['object_id']] = $image['images'][2]['source'];
}

/*
print "<pre>";
print_r($images);
print "</pre>";
*/

$sql->mysql_select("image", "*","`image_gallery` = '".$albumid."'");
$sqlimage = $sql->get_table();

$page_title = "Album elemeinek szerkesztése";

$page_text = "";

$page_text .= "
	<form enctype='multipart/form-data' method='post' action='modules/gallery/action_gallery.php'>
		<input type='hidden' name='action' value='bann' />
			<table cellspacing='0' cellpadding='0' class='admin_list ui-corner-all'>
				<tr class='admin_list_header'>
					<td class='admin_list_id ui-widget-header ui-corner-bottom'>
						ID
					</td>
					<td class='ui-widget-header ui-corner-bottom admin_list_category'>
						Kép
					</td>
					<td class='admin_list_title ui-widget-header ui-corner-bottom'>
						Kép neve
					</td>
					<td class='admin_list_action ui-widget-header ui-corner-bottom' style='width:200px;'>
						Műveletek
					</td>
				</tr>
";

foreach ($sqlimage as $image) {
	$page_text .= "
		<tr class='admin_list_body'>
			<td class='admin_list_id ui-corner-bottom'>
				".$image['image_id']."
			</td>
			<td class='ui-corner-bottom admin_list_id'>
				<img src='".$imagesrc[$image['image_id']]."' />
			</td>
			<td class='admin_list_title ui-corner-bottom'>
				".$image['image_name']."
			</td>
			<td class='admin_list_action ui-corner-bottom'>
				<input type='checkbox' name='deleteimage[]' value='".$image['image_id']."' />Kép törlése<br />
				<input type='checkbox' name='bannuser[]' value='".$image['image_id']."' />Felhasználó bannolása
			</td>
		</tr>
	";
}

$page_text .= "
			</table>
		<div class='admin_button'>
			<input type='submit' class='ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only' value='Végrehajtás' />
		</div>
	</form>
";

?>